﻿@using KnockoutSignalR
@model KnockoutSignalR.Sample.Models.TestModel

@{
    ViewBag.Title = "title";
}
<script type="text/javascript">
    $(function() {
        var vm = @Model.GetViewModel("vm", null);
        vm.SomeTextPropertyLength = ko.computed(function() {
            return vm.SomeTextProperty().length;
        });
    });
    
</script>
<h2 @Html.DataBind(_=>_.Text(m=>m.SomeTextProperty))></h2>
<input @Html.DataBind(_=>_.Value(m=>m.SomeTextProperty))/>
<p>Length: <span @Html.DataBind(_ => _.Text("SomeTextPropertyLength"))></span></p>
<button @Html.DataBind(_=>_.Click(m=>m.UpperCaseName()))>Make Upper Case</button>

<h2 @Html.DataBind(_=>_.Text(m=>m.NonStaticString))></h2>
<input @Html.DataBind(_ => _.Value(m => m.NonStaticString))/>